<form method="post" name="new_unit_form" action="?option=<?php echo COMPONENT_NAME;?>&user=owner&page=home">
<table width="100%" border="0">
  <tr class="HeaderTr">
    <td colspan="2"><h1 class="Main">Rental Unit Information</h1></td>
  </tr>
  <tr>
    <td width="20%">Hotel</td>
    <td><input type="checkbox" id="hotel" name="unit[is_hotel]" onclick="alter_group_display(this)" /></td>
  </tr>
  <tr>
    <td>Group</td>
    <td><input type="checkbox" id="group" name="unit[is_group]" onclick="alter_total_units(this)" /></td>
  </tr>
  <tr>
    <td>Total Units</td>
    <td><input type="text" size="5" id="total_units" name="unit[no_of_units]" readonly /></td>
  </tr>
  <tr>
    <td>Name</td>
    <td><input type="text" size="45" name="unit[name]" /></td>
  </tr>
  <tr>
    <td>Address *</td>
    <td><input type="text" size="45" name="unit[address]" /></td>
  </tr>
  <tr>
    <td>Listing Title *</td>
    <td><input type="text" size="45" name="unit[title]" /></td>
  </tr>
  <tr>
    <td>Description</td>
    <td><textarea cols="50" name="unit[description]"></textarea></td>
  </tr>
  <tr>
    <td>Bedrooms</td>
    <td><input type="text" size="5" name="unit[bedrooms]" /></td>
  </tr>
  <tr>
    <td>Published</td>
    <td>
    	<select name="unit[published]">
        <option value="1">Yes</option>
        <option value="0">No</option>
        </select>
    </td>
  </tr>
</table>
<input type="hidden" name="form" value="new_unit">
</form>
<?php $KToolBar->addLink('<a href="#" onclick="document.new_unit_form.submit()"><img border="0" alt="Save" src="'.ADMIN_COMPONENT_PATH.'images/save_f2.png"/><br />Save</a>');?>
<?php $KToolBar->addLink('<a href="?option='.COMPONENT_NAME.'&user=owner&page=home"><img border="0" alt="Cancel" src="'.ADMIN_COMPONENT_PATH.'images/cancel_f2.png"/><br />Cancel</a>');?>
<script>
function alter_group_display(ele){
	if(ele.checked) $('#group').attr("disabled", "true");
	else $('#group').removeAttr("disabled");
}
function alter_total_units(ele){
	if(ele.checked){
		 $('#total_units').removeAttr("readonly");
		 $('#hotel').attr("disabled", "true");
	}
	else {
		$('#total_units').attr("readonly", "readonly");
		$('#total_units').val("");
		$('#hotel').removeAttr("disabled");
	}
}
</script>